Skip to content

Delay registering commerce_customer addressfield#43

Closed
aheathgr wants to merge 1 commit into
backdrop-contrib:1.x-1.xfrom
aheathgr:issues/42
Closed

Delay registering commerce_customer addressfield#43
aheathgr wants to merge 1 commit into
backdrop-contrib:1.x-1.xfrom
aheathgr:issues/42

Conversation

@aheathgr

Copy link
Copy Markdown
Contributor

Fixes #42

This is an issue with the timing of things! If we haven't already enabled addressfield when we enable commerce_customer, Backdrop tries to register field_commerce_customer_address.json from the config directory before the addressfield module has made the addressfield field type available. This results in an error that the addressfield module isn't available (which it isn't!).

We need to delay the loading of the field config file until all modules are fully installed and field types are registered, and we can do that by moving it to a hook_update().

We need to move that config file into a subdirectory of config, which I'm not crazy about, but this works.

Fixes backdrop-contrib#42

This is an issue with the timing of things! If we haven't already
enabled addressfield when we enable commerce_customer, Backdrop tries to
register field_commerce_customer_address.json from the config directory
before the addressfield module has made the addressfield field type
available. This results in an error that the addressfield module isn't
available (which it isn't!).

We need to delay the loading of the field config file until all modules
are fully installed and field types are registered, and we can do that
by moving it to a hook_update().

We need to move that config file into a subdirectory of config, which
I'm not crazy about, but this works.
@elisseck

elisseck commented Aug 9, 2025

Copy link
Copy Markdown
Collaborator

@aheathgr can you say more about why "We need to move that config file into a subdirectory of config"? I'm a bit confused by that part of this changeset.

@laryn

laryn commented Aug 9, 2025

Copy link
Copy Markdown
Member

There was some discussion in the issue itself:

#42

@argiepiano

Copy link
Copy Markdown
Contributor

This PR should be closed, as the issue was fixed in a different way.

@aheathgr

aheathgr commented Aug 9, 2025

Copy link
Copy Markdown
Contributor Author

@elisseck I thought I had closed this - and yes, we're going to adjust this as per #42 (comment), just haven't had a chance to circle back yet.

@aheathgr aheathgr closed this Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

commerce_customer attempts to create addressfield before addressfield type is registered

4 participants